package vip.xiaonuo.modular.cms.enums;

/**
 * @ProjectName: snowy_layui_cms
 * @Package: vip.xiaonuo.modular.cms.enums
 * @ClassName: ArticleTypeEnum
 * @Author: liubaihan
 * @Description: 文章类型枚举
 * @Date: 2022/9/9 13:53
 */
public enum  ArticleTypeEnum {

    ARTICLE("文章", 1),
    PAGE("页面", 2),
    PRODUCT("产品", 3);

    // 成员变量
    private String name;
    private int index;
    // 构造方法
    private ArticleTypeEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(int index) {
        for (ArticleTypeEnum c : ArticleTypeEnum.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }

}
